home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / makebin.com / BINDEMO2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-04-16  |  1.1 KB  |  50 lines

  1.  
  2. {$M 1024,0,0}    {use the smallest memory possible}
  3. {$F+,R-}            {we want this to be FAR}
  4.  
  5. {BINDEMO2  V1.01  Copyright 1989  Michael Day   as of 16 April 1989}
  6. {all rights reserved}
  7. PROGRAM BinDemo2;
  8. uses DOS,BinIpc;
  9.  
  10. var  Dbs : string;
  11.      Pass : integer;
  12.  
  13. {$F+}
  14. procedure DoHello; {Re-entrancy procedure - do not call from main program}
  15. begin
  16.    SwapVectors;
  17.    writeln('Hello again from the BIN Program: ',Pass);
  18.    inc(Pass);
  19.    SwapVectors;
  20. end;
  21.  
  22. procedure Pad(var S:string);
  23. begin
  24.   while length(S) < pred(sizeof(S)) do
  25.     S := S+' ';
  26. end;
  27.  
  28. begin
  29.   if IPC = nil then
  30.   begin
  31.     writeln('Hey, you''re trying to run this from DOS. No can do.');
  32.     halt(1);
  33.   end;
  34.   BinLoadCheck;
  35.   writeln('We are now inside the BIN program');
  36.   Pass := 1;
  37.   if GetDbString(DbS) then
  38.   begin
  39.     writeln(Dbs);
  40.     Dbs := 'This is a message passed back to the database program';
  41.     Pad(Dbs);
  42.     if SetDbString(DbS) then {nop};
  43.   end;
  44.  
  45.   SetBinEntry(DoHello);   {set new entry point}
  46.   SwapVectors;            {restore the vectors}
  47.   Keep(0);                {keep things around}
  48. end.
  49.  
  50.